cmake_minimum_required(VERSION 3.10)
project(cpp_utils)

# 设置C++标准
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 添加共享库
add_library(cpp_utils SHARED
    src/math_utils.cpp
    src/string_utils.cpp
    src/geometry.cpp
)

# 包含目录
target_include_directories(cpp_utils PUBLIC
    include
)

# 设置输出目录
set_target_properties(cpp_utils PROPERTIES
    LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
    ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
)

# 在Windows上避免名称冲突
if(WIN32)
    set_target_properties(cpp_utils PROPERTIES PREFIX "")
endif()